<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Eletronet</title>
</head>
<body>

	<form id="form1" name="form1" method="post" action="MostrarPublicacionServlet">
		<a href="#" class="dropdown-toggle" data-toggle="dropdown">Mostrar Publicacion<b class="caret"></b></a><br><br><br>	
				 		
		Buscar Publicacion: <input type="text" name="txtTitulo" id="txtTitulo"/>
		<input type="submit" value="Buscar" name="button" id="button" /><br><br>
	</form>
			
		<div class="table-responsive">
			<table width="550" height="65" border="1" cellpadding="0" cellspacing="0" class="table table-hover">
			  <tr>
			    <th width="200" scope="col">Vendedor</th>
			    <th width="300" scope="col">Publicacion</th>
			    <th width="500" scope="col">Detalle</th>
			    <th width="192" scope="col">Precio</th>
			  </tr>
			  
			  <%@page import="java.util.*, electronet.modelo.Publicacion" %>
			  <%@page import="java.util.*, electronet.negocio.GestionConsultaPublicaciones" %>
			  
			<%
				Collection<Publicacion> arrPubli = (ArrayList<Publicacion>)request.getAttribute("publicacion");
				GestionConsultaPublicaciones GestionPu = new GestionConsultaPublicaciones();
			  
				if(arrPubli != null) { 
				int i = 1;
				for(Publicacion pu : arrPubli) {
				%>  
				  <tr>
				    <%--<td><%=i++ %></td>--%>
				    <td><% out.print(GestionPu.NombreVendedor(pu.getIdPersona())); %></td>				    				    
				    <td><% out.print(pu.getTitulo()); %></td>
				    <td><% out.print(pu.getDescripcion()); %></td>
				    <td><% out.print(pu.getPrecio()); %></td>
		    <% }
			  } %>
			  
			</table>
		</div>
			    



</body>
</html>